In recent years, a motor having a small cogging torque has been demanded for various applications, which include, for example, an industrial servomotor and a hoisting machine for an elevator. Paying attention to the applications to vehicles, electric power steering devices have become widely used to improve fuel efficiency and steering ease. A cogging torque of a motor used for the electric power steering device is transmitted to a driver through an intermediation of a gear. Therefore, in order to obtain smooth steering feel, there is a strong request for a reduction in the cogging torque of the motor. In response to this request, a method of moving permanent magnets to adjust the cogging torque by using linear programming (for example, see Patent Document 1) and a method of reducing a 6×p-th order harmonic wave (p is the number of pole pairs) of the cogging torque in the case where a ratio of the number of slots and the number of poles is 3:2 (for example, see Patent Document 2) have been disclosed as techniques of reducing the cogging torque.    Patent Document 1: JP 2006-60920 A    Patent Document 2: JP 2006-514522 A